;; i32 operations

(module
  ;; (import "wasi_unstable" "fd_write" (func $wasi_fd_write (param i32 i32 i32 i32) (result i32)))
  (import "wasi" "print_i32_ln" (func $wasi$print_i32_ln (param i32)))

  (func $add (export "add") (param $x i32) (param $y i32) (result i32) (i32.add (local.get $x) (local.get $y)))
  (func $sub (export "sub") (param $x i32) (param $y i32) (result i32) (i32.sub (local.get $x) (local.get $y)))
  (func $mul (export "mul") (param $x i32) (param $y i32) (result i32) (i32.mul (local.get $x) (local.get $y)))
  (func $div_s (export "div_s") (param $x i32) (param $y i32) (result i32) (i32.div_s (local.get $x) (local.get $y)))
  (func $div_u (export "div_u") (param $x i32) (param $y i32) (result i32) (i32.div_u (local.get $x) (local.get $y)))
  (func $rem_s (export "rem_s") (param $x i32) (param $y i32) (result i32) (i32.rem_s (local.get $x) (local.get $y)))
  (func $rem_u (export "rem_u") (param $x i32) (param $y i32) (result i32) (i32.rem_u (local.get $x) (local.get $y)))
  (func $and (export "and") (param $x i32) (param $y i32) (result i32) (i32.and (local.get $x) (local.get $y)))
  (func $or (export "or") (param $x i32) (param $y i32) (result i32) (i32.or (local.get $x) (local.get $y)))
  (func $xor (export "xor") (param $x i32) (param $y i32) (result i32) (i32.xor (local.get $x) (local.get $y)))
  (func $shl (export "shl") (param $x i32) (param $y i32) (result i32) (i32.shl (local.get $x) (local.get $y)))
  (func $shr_s (export "shr_s") (param $x i32) (param $y i32) (result i32) (i32.shr_s (local.get $x) (local.get $y)))
  (func $shr_u (export "shr_u") (param $x i32) (param $y i32) (result i32) (i32.shr_u (local.get $x) (local.get $y)))
;;  (func $rotl (export "rotl") (param $x i32) (param $y i32) (result i32) (i32.rotl (local.get $x) (local.get $y)))
;;  (func $rotr (export "rotr") (param $x i32) (param $y i32) (result i32) (i32.rotr (local.get $x) (local.get $y)))
  (func $clz (export "clz") (param $x i32) (result i32) (i32.clz (local.get $x)))
  (func $ctz (export "ctz") (param $x i32) (result i32) (i32.ctz (local.get $x)))
;;  (func $popcnt (export "popcnt") (param $x i32) (result i32) (i32.popcnt (local.get $x)))
;;  (func $extend8_s (export "extend8_s") (param $x i32) (result i32) (i32.extend8_s (local.get $x)))
;;  (func $extend16_s (export "extend16_s") (param $x i32) (result i32) (i32.extend16_s (local.get $x)))
  (func $eqz (export "eqz") (param $x i32) (result i32) (i32.eqz (local.get $x)))
  (func $eq (export "eq") (param $x i32) (param $y i32) (result i32) (i32.eq (local.get $x) (local.get $y)))
  (func $ne (export "ne") (param $x i32) (param $y i32) (result i32) (i32.ne (local.get $x) (local.get $y)))
  (func $lt_s (export "lt_s") (param $x i32) (param $y i32) (result i32) (i32.lt_s (local.get $x) (local.get $y)))
  (func $lt_u (export "lt_u") (param $x i32) (param $y i32) (result i32) (i32.lt_u (local.get $x) (local.get $y)))
  (func $le_s (export "le_s") (param $x i32) (param $y i32) (result i32) (i32.le_s (local.get $x) (local.get $y)))
  (func $le_u (export "le_u") (param $x i32) (param $y i32) (result i32) (i32.le_u (local.get $x) (local.get $y)))
  (func $gt_s (export "gt_s") (param $x i32) (param $y i32) (result i32) (i32.gt_s (local.get $x) (local.get $y)))
  (func $gt_u (export "gt_u") (param $x i32) (param $y i32) (result i32) (i32.gt_u (local.get $x) (local.get $y)))
  (func $ge_s (export "ge_s") (param $x i32) (param $y i32) (result i32) (i32.ge_s (local.get $x) (local.get $y)))
  (func $ge_u (export "ge_u") (param $x i32) (param $y i32) (result i32) (i32.ge_u (local.get $x) (local.get $y)))



 (func $assert_eq_i32 (param $line i32) (param $x i32) (param $y i32)
       (if (i32.ne (local.get 1) (local.get 2))
           (then
	       (call $wasi$print_i32_ln  (local.get 0))
	       (call $wasi$print_i32_ln  (local.get 1))
	       (call $wasi$print_i32_ln  (local.get 2))
	       (unreachable))
       )
 )

 (func $main (export "_start")
       (call $assert_eq_i32 (i32.const 1000) (call $add (i32.const 1) (i32.const 1)) (i32.const 2))
       (call $assert_eq_i32 (i32.const 1000) (call $add (i32.const 1) (i32.const 0)) (i32.const 1))
       (call $assert_eq_i32 (i32.const 1000) (call $add (i32.const -1) (i32.const -1)) (i32.const -2))
       (call $assert_eq_i32 (i32.const 1000) (call $add (i32.const -1) (i32.const 1)) (i32.const 0))
       (call $assert_eq_i32 (i32.const 1000) (call $add (i32.const 0x7fffffff) (i32.const 1)) (i32.const 0x80000000))
       (call $assert_eq_i32 (i32.const 1000) (call $add (i32.const 0x80000000) (i32.const -1)) (i32.const 0x7fffffff))
       (call $assert_eq_i32 (i32.const 1000) (call $add (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0))
       (call $assert_eq_i32 (i32.const 1000) (call $add (i32.const 0x3fffffff) (i32.const 1)) (i32.const 0x40000000))

       (call $assert_eq_i32 (i32.const 2000) (call $sub (i32.const 1) (i32.const 1)) (i32.const 0))
       (call $assert_eq_i32 (i32.const 2000) (call $sub (i32.const 1) (i32.const 0)) (i32.const 1))
       (call $assert_eq_i32 (i32.const 2000) (call $sub (i32.const -1) (i32.const -1)) (i32.const 0))
       (call $assert_eq_i32 (i32.const 2000) (call $sub (i32.const 0x7fffffff) (i32.const -1)) (i32.const 0x80000000))
       (call $assert_eq_i32 (i32.const 2000) (call $sub (i32.const 0x80000000) (i32.const 1)) (i32.const 0x7fffffff))
       (call $assert_eq_i32 (i32.const 2000) (call $sub (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0))
       (call $assert_eq_i32 (i32.const 2000) (call $sub (i32.const 0x3fffffff) (i32.const -1)) (i32.const 0x40000000))

       (call $assert_eq_i32 (i32.const 3000) (call $mul (i32.const 1) (i32.const 1)) (i32.const 1))
       (call $assert_eq_i32 (i32.const 3000) (call $mul (i32.const 1) (i32.const 0)) (i32.const 0))
       (call $assert_eq_i32 (i32.const 3000) (call $mul (i32.const -1) (i32.const -1)) (i32.const 1))
       (call $assert_eq_i32 (i32.const 3000) (call $mul (i32.const 0x10000000) (i32.const 4096)) (i32.const 0))
       (call $assert_eq_i32 (i32.const 3000) (call $mul (i32.const 0x80000000) (i32.const 0)) (i32.const 0))
       (call $assert_eq_i32 (i32.const 3000) (call $mul (i32.const 0x80000000) (i32.const -1)) (i32.const 0x80000000))
       (call $assert_eq_i32 (i32.const 3000) (call $mul (i32.const 0x7fffffff) (i32.const -1)) (i32.const 0x80000001))
       (call $assert_eq_i32 (i32.const 3000) (call $mul (i32.const 0x01234567) (i32.const 0x76543210)) (i32.const 0x358e7470))
       (call $assert_eq_i32 (i32.const 3000) (call $mul (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1))

       ;;(assert_trap (call $div_s (i32.const 1) (i32.const 0)) "integer divide by zero")
       ;;(assert_trap (call $div_s (i32.const 0) (i32.const 0)) "integer divide by zero")
       ;;(assert_trap (call $div_s (i32.const 0x80000000) (i32.const -1)) "integer overflow")
       ;;(assert_trap (call $div_s (i32.const 0x80000000) (i32.const 0)) "integer divide by zero")
       (call $assert_eq_i32 (i32.const 4000) (call $div_s (i32.const 1) (i32.const 1)) (i32.const 1))
       (call $assert_eq_i32 (i32.const 4000) (call $div_s (i32.const 0) (i32.const 1)) (i32.const 0))
       (call $assert_eq_i32 (i32.const 4000) (call $div_s (i32.const 0) (i32.const -1)) (i32.const 0))
       (call $assert_eq_i32 (i32.const 4000) (call $div_s (i32.const -1) (i32.const -1)) (i32.const 1))
       (call $assert_eq_i32 (i32.const 4000) (call $div_s (i32.const 0x80000000) (i32.const 2)) (i32.const 0xc0000000))
       (call $assert_eq_i32 (i32.const 4000) (call $div_s (i32.const 0x80000001) (i32.const 1000)) (i32.const 0xffdf3b65))
       (call $assert_eq_i32 (i32.const 4000) (call $div_s (i32.const 5) (i32.const 2)) (i32.const 2))
       (call $assert_eq_i32 (i32.const 4000) (call $div_s (i32.const -5) (i32.const 2)) (i32.const -2))
       (call $assert_eq_i32 (i32.const 4000) (call $div_s (i32.const 5) (i32.const -2)) (i32.const -2))
       (call $assert_eq_i32 (i32.const 4000) (call $div_s (i32.const -5) (i32.const -2)) (i32.const 2))
       (call $assert_eq_i32 (i32.const 4000) (call $div_s (i32.const 7) (i32.const 3)) (i32.const 2))
       (call $assert_eq_i32 (i32.const 4000) (call $div_s (i32.const -7) (i32.const 3)) (i32.const -2))
       (call $assert_eq_i32 (i32.const 4000) (call $div_s (i32.const 7) (i32.const -3)) (i32.const -2))
       (call $assert_eq_i32 (i32.const 4000) (call $div_s (i32.const -7) (i32.const -3)) (i32.const 2))
       (call $assert_eq_i32 (i32.const 4000) (call $div_s (i32.const 11) (i32.const 5)) (i32.const 2))
       (call $assert_eq_i32 (i32.const 4000) (call $div_s (i32.const 17) (i32.const 7)) (i32.const 2))
      
      ;; (assert_trap (call $div_u (i32.const 1) (i32.const 0)) "integer divide by zero")
      ;; (assert_trap (call $div_u (i32.const 0) (i32.const 0)) "integer divide by zero")
      (call $assert_eq_i32 (i32.const 5000) (call $div_u (i32.const 1) (i32.const 1)) (i32.const 1))
      (call $assert_eq_i32 (i32.const 5000) (call $div_u (i32.const 0) (i32.const 1)) (i32.const 0))
      (call $assert_eq_i32 (i32.const 5000) (call $div_u (i32.const -1) (i32.const -1)) (i32.const 1))
      (call $assert_eq_i32 (i32.const 5000) (call $div_u (i32.const 0x80000000) (i32.const -1)) (i32.const 0))
      (call $assert_eq_i32 (i32.const 5000) (call $div_u (i32.const 0x80000000) (i32.const 2)) (i32.const 0x40000000))
      (call $assert_eq_i32 (i32.const 5000) (call $div_u (i32.const 0x8ff00ff0) (i32.const 0x10001)) (i32.const 0x8fef))
      (call $assert_eq_i32 (i32.const 5000) (call $div_u (i32.const 0x80000001) (i32.const 1000)) (i32.const 0x20c49b))
      (call $assert_eq_i32 (i32.const 5000) (call $div_u (i32.const 5) (i32.const 2)) (i32.const 2))
      (call $assert_eq_i32 (i32.const 5000) (call $div_u (i32.const -5) (i32.const 2)) (i32.const 0x7ffffffd))
      (call $assert_eq_i32 (i32.const 5000) (call $div_u (i32.const 5) (i32.const -2)) (i32.const 0))
      (call $assert_eq_i32 (i32.const 5000) (call $div_u (i32.const -5) (i32.const -2)) (i32.const 0))
      (call $assert_eq_i32 (i32.const 5000) (call $div_u (i32.const 7) (i32.const 3)) (i32.const 2))
      (call $assert_eq_i32 (i32.const 5000) (call $div_u (i32.const 11) (i32.const 5)) (i32.const 2))
      (call $assert_eq_i32 (i32.const 5000) (call $div_u (i32.const 17) (i32.const 7)) (i32.const 2))

      ;; (assert_trap (call $rem_s (i32.const 1) (i32.const 0)) "integer divide by zero")
      ;; (assert_trap (call $rem_s (i32.const 0) (i32.const 0)) "integer divide by zero")
      (call $assert_eq_i32 (i32.const 6000) (call $rem_s (i32.const 0x7fffffff) (i32.const -1)) (i32.const 0))
      (call $assert_eq_i32 (i32.const 6000) (call $rem_s (i32.const 1) (i32.const 1)) (i32.const 0))
      (call $assert_eq_i32 (i32.const 6000) (call $rem_s (i32.const 0) (i32.const 1)) (i32.const 0))
      (call $assert_eq_i32 (i32.const 6000) (call $rem_s (i32.const 0) (i32.const -1)) (i32.const 0))
      (call $assert_eq_i32 (i32.const 6000) (call $rem_s (i32.const -1) (i32.const -1)) (i32.const 0))
      ;; (call $assert_eq_i32 (i32.const 6000) (call $rem_s (i32.const 0x80000000) (i32.const -1)) (i32.const 0))
      (call $assert_eq_i32 (i32.const 6000) (call $rem_s (i32.const 0x80000000) (i32.const 2)) (i32.const 0))
      (call $assert_eq_i32 (i32.const 6000) (call $rem_s (i32.const 0x80000001) (i32.const 1000)) (i32.const -647))
      (call $assert_eq_i32 (i32.const 6000) (call $rem_s (i32.const 5) (i32.const 2)) (i32.const 1))
      (call $assert_eq_i32 (i32.const 6000) (call $rem_s (i32.const -5) (i32.const 2)) (i32.const -1))
      (call $assert_eq_i32 (i32.const 6000) (call $rem_s (i32.const 5) (i32.const -2)) (i32.const 1))
      (call $assert_eq_i32 (i32.const 6000) (call $rem_s (i32.const -5) (i32.const -2)) (i32.const -1))
      (call $assert_eq_i32 (i32.const 6000) (call $rem_s (i32.const 7) (i32.const 3)) (i32.const 1))
      (call $assert_eq_i32 (i32.const 6000) (call $rem_s (i32.const -7) (i32.const 3)) (i32.const -1))
      (call $assert_eq_i32 (i32.const 6000) (call $rem_s (i32.const 7) (i32.const -3)) (i32.const 1))
      (call $assert_eq_i32 (i32.const 6000) (call $rem_s (i32.const -7) (i32.const -3)) (i32.const -1))
      (call $assert_eq_i32 (i32.const 6000) (call $rem_s (i32.const 11) (i32.const 5)) (i32.const 1))
      (call $assert_eq_i32 (i32.const 6000) (call $rem_s (i32.const 17) (i32.const 7)) (i32.const 3))

      ;;(assert_trap (call $rem_u (i32.const 1) (i32.const 0)) "integer divide by zero")
      ;;(assert_trap (call $rem_u (i32.const 0) (i32.const 0)) "integer divide by zero")
      (call $assert_eq_i32 (i32.const 7000) (call $rem_u (i32.const 1) (i32.const 1)) (i32.const 0))
      (call $assert_eq_i32 (i32.const 7000) (call $rem_u (i32.const 0) (i32.const 1)) (i32.const 0))
      (call $assert_eq_i32 (i32.const 7000) (call $rem_u (i32.const -1) (i32.const -1)) (i32.const 0))
      (call $assert_eq_i32 (i32.const 7000) (call $rem_u (i32.const 0x80000000) (i32.const -1)) (i32.const 0x80000000))
      (call $assert_eq_i32 (i32.const 7000) (call $rem_u (i32.const 0x80000000) (i32.const 2)) (i32.const 0))
      (call $assert_eq_i32 (i32.const 7000) (call $rem_u (i32.const 0x8ff00ff0) (i32.const 0x10001)) (i32.const 0x8001))
      (call $assert_eq_i32 (i32.const 7000) (call $rem_u (i32.const 0x80000001) (i32.const 1000)) (i32.const 649))
      (call $assert_eq_i32 (i32.const 7000) (call $rem_u (i32.const 5) (i32.const 2)) (i32.const 1))
      (call $assert_eq_i32 (i32.const 7000) (call $rem_u (i32.const -5) (i32.const 2)) (i32.const 1))
      (call $assert_eq_i32 (i32.const 7000) (call $rem_u (i32.const 5) (i32.const -2)) (i32.const 5))
      (call $assert_eq_i32 (i32.const 7000) (call $rem_u (i32.const -5) (i32.const -2)) (i32.const -5))
      (call $assert_eq_i32 (i32.const 7000) (call $rem_u (i32.const 7) (i32.const 3)) (i32.const 1))
      (call $assert_eq_i32 (i32.const 7000) (call $rem_u (i32.const 11) (i32.const 5)) (i32.const 1))
      (call $assert_eq_i32 (i32.const 7000) (call $rem_u (i32.const 17) (i32.const 7)) (i32.const 3))

     (call $assert_eq_i32 (i32.const 8000) (call $and (i32.const 1) (i32.const 0)) (i32.const 0))
     (call $assert_eq_i32 (i32.const 8000) (call $and (i32.const 0) (i32.const 1)) (i32.const 0))
     (call $assert_eq_i32 (i32.const 8000) (call $and (i32.const 1) (i32.const 1)) (i32.const 1))
     (call $assert_eq_i32 (i32.const 8000) (call $and (i32.const 0) (i32.const 0)) (i32.const 0))
     (call $assert_eq_i32 (i32.const 8000) (call $and (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0))
     (call $assert_eq_i32 (i32.const 8000) (call $and (i32.const 0x7fffffff) (i32.const -1)) (i32.const 0x7fffffff))
     (call $assert_eq_i32 (i32.const 8000) (call $and (i32.const 0xf0f0ffff) (i32.const 0xfffff0f0)) (i32.const 0xf0f0f0f0))
     (call $assert_eq_i32 (i32.const 8000) (call $and (i32.const 0xffffffff) (i32.const 0xffffffff)) (i32.const 0xffffffff))

    (call $assert_eq_i32 (i32.const 9000) (call $or (i32.const 1) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 9000) (call $or (i32.const 0) (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 9000) (call $or (i32.const 1) (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 9000) (call $or (i32.const 0) (i32.const 0)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 9000) (call $or (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const -1))
    (call $assert_eq_i32 (i32.const 9000) (call $or (i32.const 0x80000000) (i32.const 0)) (i32.const 0x80000000))
    (call $assert_eq_i32 (i32.const 9000) (call $or (i32.const 0xf0f0ffff) (i32.const 0xfffff0f0)) (i32.const 0xffffffff))
    (call $assert_eq_i32 (i32.const 1000) (call $or (i32.const 0xffffffff) (i32.const 0xffffffff)) (i32.const 0xffffffff))

    (call $assert_eq_i32 (i32.const 1100) (call $xor (i32.const 1) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 1100) (call $xor (i32.const 0) (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 1100) (call $xor (i32.const 1) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 1100) (call $xor (i32.const 0) (i32.const 0)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 1100) (call $xor (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const -1))
    (call $assert_eq_i32 (i32.const 1100) (call $xor (i32.const 0x80000000) (i32.const 0)) (i32.const 0x80000000))
    (call $assert_eq_i32 (i32.const 1100) (call $xor (i32.const -1) (i32.const 0x80000000)) (i32.const 0x7fffffff))
    (call $assert_eq_i32 (i32.const 1100) (call $xor (i32.const -1) (i32.const 0x7fffffff)) (i32.const 0x80000000))
    (call $assert_eq_i32 (i32.const 1100) (call $xor (i32.const 0xf0f0ffff) (i32.const 0xfffff0f0)) (i32.const 0x0f0f0f0f))
    (call $assert_eq_i32 (i32.const 1100) (call $xor (i32.const 0xffffffff) (i32.const 0xffffffff)) (i32.const 0))

    (call $assert_eq_i32 (i32.const 1201) (call $shl (i32.const 1) (i32.const 1)) (i32.const 2))
    (call $assert_eq_i32 (i32.const 1202) (call $shl (i32.const 1) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 1203) (call $shl (i32.const 0x7fffffff) (i32.const 1)) (i32.const 0xfffffffe))
    (call $assert_eq_i32 (i32.const 1204) (call $shl (i32.const 0xffffffff) (i32.const 1)) (i32.const 0xfffffffe))
    (call $assert_eq_i32 (i32.const 1205) (call $shl (i32.const 0x80000000) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 1206) (call $shl (i32.const 0x40000000) (i32.const 1)) (i32.const 0x80000000))
    (call $assert_eq_i32 (i32.const 1207) (call $shl (i32.const 1) (i32.const 31)) (i32.const 0x80000000))
    ;; (call $assert_eq_i32 (i32.const 1208) (call $shl (i32.const 1) (i32.const 32)) (i32.const 1))
    ;; (call $assert_eq_i32 (i32.const 1209) (call $shl (i32.const 1) (i32.const 33)) (i32.const 2))
    ;; (call $assert_eq_i32 (i32.const 1210) (call $shl (i32.const 1) (i32.const -1)) (i32.const 0x80000000))
    ;; (call $assert_eq_i32 (i32.const 1211) (call $shl (i32.const 1) (i32.const 0x7fffffff)) (i32.const 0x80000000))

    (call $assert_eq_i32 (i32.const 1301) (call $shr_s (i32.const 1) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 1302) (call $shr_s (i32.const 1) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 1303) (call $shr_s (i32.const -1) (i32.const 1)) (i32.const -1))
    (call $assert_eq_i32 (i32.const 1304) (call $shr_s (i32.const 0x7fffffff) (i32.const 1)) (i32.const 0x3fffffff))
    (call $assert_eq_i32 (i32.const 1305) (call $shr_s (i32.const 0x80000000) (i32.const 1)) (i32.const 0xc0000000))
    (call $assert_eq_i32 (i32.const 1306) (call $shr_s (i32.const 0x40000000) (i32.const 1)) (i32.const 0x20000000))
;;    (call $assert_eq_i32 (i32.const 1307) (call $shr_s (i32.const 1) (i32.const 32)) (i32.const 1))
;;    (call $assert_eq_i32 (i32.const 1308) (call $shr_s (i32.const 1) (i32.const 33)) (i32.const 0))
;;    (call $assert_eq_i32 (i32.const 1309) (call $shr_s (i32.const 1) (i32.const -1)) (i32.const 0))
;;    (call $assert_eq_i32 (i32.const 1310) (call $shr_s (i32.const 1) (i32.const 0x7fffffff)) (i32.const 0))
;;    (call $assert_eq_i32 (i32.const 1311) (call $shr_s (i32.const 1) (i32.const 0x80000000)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 1312) (call $shr_s (i32.const 0x80000000) (i32.const 31)) (i32.const -1))
;;    (call $assert_eq_i32 (i32.const 1300) (call $shr_s (i32.const -1) (i32.const 32)) (i32.const -1))
;;    (call $assert_eq_i32 (i32.const 1300) (call $shr_s (i32.const -1) (i32.const 33)) (i32.const -1))
;;    (call $assert_eq_i32 (i32.const 1300) (call $shr_s (i32.const -1) (i32.const -1)) (i32.const -1))
;;    (call $assert_eq_i32 (i32.const 1300) (call $shr_s (i32.const -1) (i32.const 0x7fffffff)) (i32.const -1))
;;    (call $assert_eq_i32 (i32.const 1300) (call $shr_s (i32.const -1) (i32.const 0x80000000)) (i32.const -1))

    (call $assert_eq_i32 (i32.const 1400) (call $shr_u (i32.const 1) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 1400) (call $shr_u (i32.const 1) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 1400) (call $shr_u (i32.const -1) (i32.const 1)) (i32.const 0x7fffffff))
    (call $assert_eq_i32 (i32.const 1400) (call $shr_u (i32.const 0x7fffffff) (i32.const 1)) (i32.const 0x3fffffff))
    (call $assert_eq_i32 (i32.const 1400) (call $shr_u (i32.const 0x80000000) (i32.const 1)) (i32.const 0x40000000))
    (call $assert_eq_i32 (i32.const 1400) (call $shr_u (i32.const 0x40000000) (i32.const 1)) (i32.const 0x20000000))
;;    (call $assert_eq_i32 (i32.const 1400) (call $shr_u (i32.const 1) (i32.const 32)) (i32.const 1))
;;    (call $assert_eq_i32 (i32.const 1400) (call $shr_u (i32.const 1) (i32.const 33)) (i32.const 0))
;;    (call $assert_eq_i32 (i32.const 1400) (call $shr_u (i32.const 1) (i32.const -1)) (i32.const 0))
;;    (call $assert_eq_i32 (i32.const 1400) (call $shr_u (i32.const 1) (i32.const 0x7fffffff)) (i32.const 0))
;;    (call $assert_eq_i32 (i32.const 1400) (call $shr_u (i32.const 1) (i32.const 0x80000000)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 1400) (call $shr_u (i32.const 0x80000000) (i32.const 31)) (i32.const 1))
;;    (call $assert_eq_i32 (i32.const 1400) (call $shr_u (i32.const -1) (i32.const 32)) (i32.const -1))
;;    (call $assert_eq_i32 (i32.const 1400) (call $shr_u (i32.const -1) (i32.const 33)) (i32.const 0x7fffffff))
;;    (call $assert_eq_i32 (i32.const 1400) (call $shr_u (i32.const -1) (i32.const -1)) (i32.const 1))
;;    (call $assert_eq_i32 (i32.const 1400) (call $shr_u (i32.const -1) (i32.const 0x7fffffff)) (i32.const 1))
;;    (call $assert_eq_i32 (i32.const 1400) (call $shr_u (i32.const -1) (i32.const 0x80000000)) (i32.const -1))

;;   (call $assert_eq_i32 (i32.const 1000) (call $rotl (i32.const 1) (i32.const 1)) (i32.const 2))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotl (i32.const 1) (i32.const 0)) (i32.const 1))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotl (i32.const -1) (i32.const 1)) (i32.const -1))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotl (i32.const 1) (i32.const 32)) (i32.const 1))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotl (i32.const 0xabcd9876) (i32.const 1)) (i32.const 0x579b30ed))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotl (i32.const 0xfe00dc00) (i32.const 4)) (i32.const 0xe00dc00f))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotl (i32.const 0xb0c1d2e3) (i32.const 5)) (i32.const 0x183a5c76))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotl (i32.const 0x00008000) (i32.const 37)) (i32.const 0x00100000))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotl (i32.const 0xb0c1d2e3) (i32.const 0xff05)) (i32.const 0x183a5c76))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotl (i32.const 0x769abcdf) (i32.const 0xffffffed)) (i32.const 0x579beed3))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotl (i32.const 0x769abcdf) (i32.const 0x8000000d)) (i32.const 0x579beed3))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotl (i32.const 1) (i32.const 31)) (i32.const 0x80000000))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotl (i32.const 0x80000000) (i32.const 1)) (i32.const 1))

;;   (call $assert_eq_i32 (i32.const 1000) (call $rotr (i32.const 1) (i32.const 1)) (i32.const 0x80000000))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotr (i32.const 1) (i32.const 0)) (i32.const 1))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotr (i32.const -1) (i32.const 1)) (i32.const -1))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotr (i32.const 1) (i32.const 32)) (i32.const 1))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotr (i32.const 0xff00cc00) (i32.const 1)) (i32.const 0x7f806600))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotr (i32.const 0x00080000) (i32.const 4)) (i32.const 0x00008000))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotr (i32.const 0xb0c1d2e3) (i32.const 5)) (i32.const 0x1d860e97))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotr (i32.const 0x00008000) (i32.const 37)) (i32.const 0x00000400))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotr (i32.const 0xb0c1d2e3) (i32.const 0xff05)) (i32.const 0x1d860e97))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotr (i32.const 0x769abcdf) (i32.const 0xffffffed)) (i32.const 0xe6fbb4d5))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotr (i32.const 0x769abcdf) (i32.const 0x8000000d)) (i32.const 0xe6fbb4d5))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotr (i32.const 1) (i32.const 31)) (i32.const 2))
;;   (call $assert_eq_i32 (i32.const 1000) (call $rotr (i32.const 0x80000000) (i32.const 31)) (i32.const 1))

     (call $assert_eq_i32 (i32.const 1000) (call $clz (i32.const 0xffffffff)) (i32.const 0))
     (call $assert_eq_i32 (i32.const 1000) (call $clz (i32.const 0)) (i32.const 32))
     (call $assert_eq_i32 (i32.const 1000) (call $clz (i32.const 0x00008000)) (i32.const 16))
     (call $assert_eq_i32 (i32.const 1000) (call $clz (i32.const 0xff)) (i32.const 24))
     (call $assert_eq_i32 (i32.const 1000) (call $clz (i32.const 0x80000000)) (i32.const 0))
     (call $assert_eq_i32 (i32.const 1000) (call $clz (i32.const 1)) (i32.const 31))
     (call $assert_eq_i32 (i32.const 1000) (call $clz (i32.const 2)) (i32.const 30))
     (call $assert_eq_i32 (i32.const 1000) (call $clz (i32.const 0x7fffffff)) (i32.const 1)
     (call $assert_eq_i32 (i32.const 1000) (call $ctz (i32.const -1)) (i32.const 0))
     (call $assert_eq_i32 (i32.const 1000) (call $ctz (i32.const 0)) (i32.const 32))
     (call $assert_eq_i32 (i32.const 1000) (call $ctz (i32.const 0x00008000)) (i32.const 15))
     (call $assert_eq_i32 (i32.const 1000) (call $ctz (i32.const 0x00010000)) (i32.const 16))
     (call $assert_eq_i32 (i32.const 1000) (call $ctz (i32.const 0x80000000)) (i32.const 31))
     (call $assert_eq_i32 (i32.const 1000) (call $ctz (i32.const 0x7fffffff)) (i32.const 0))

;;   (call $assert_eq_i32 (i32.const 1000) (call $popcnt (i32.const -1)) (i32.const 32))
;;   (call $assert_eq_i32 (i32.const 1000) (call $popcnt (i32.const 0)) (i32.const 0))
;;   (call $assert_eq_i32 (i32.const 1000) (call $popcnt (i32.const 0x00008000)) (i32.const 1))
;;   (call $assert_eq_i32 (i32.const 1000) (call $popcnt (i32.const 0x80008000)) (i32.const 2))
;;   (call $assert_eq_i32 (i32.const 1000) (call $popcnt (i32.const 0x7fffffff)) (i32.const 31))
;;   (call $assert_eq_i32 (i32.const 1000) (call $popcnt (i32.const 0xAAAAAAAA)) (i32.const 16))
;;   (call $assert_eq_i32 (i32.const 1000) (call $popcnt (i32.const 0x55555555)) (i32.const 16))
;;   (call $assert_eq_i32 (i32.const 1000) (call $popcnt (i32.const 0xDEADBEEF)) (i32.const 24))

;;    (call $assert_eq_i32 (i32.const 1000) (call $extend8_s (i32.const 0)) (i32.const 0))
;;    (call $assert_eq_i32 (i32.const 1000) (call $extend8_s (i32.const 0x7f)) (i32.const 127))
;;    (call $assert_eq_i32 (i32.const 1000) (call $extend8_s (i32.const 0x80)) (i32.const -128))
;;    (call $assert_eq_i32 (i32.const 1000) (call $extend8_s (i32.const 0xff)) (i32.const -1))
;;    (call $assert_eq_i32 (i32.const 1000) (call $extend8_s (i32.const 0x012345_00)) (i32.const 0))
;;    (call $assert_eq_i32 (i32.const 1000) (call $extend8_s (i32.const 0xfedcba_80)) (i32.const -0x80))
;;    (call $assert_eq_i32 (i32.const 1000) (call $extend8_s (i32.const -1)) (i32.const -1))

;;    (call $assert_eq_i32 (i32.const 1000) (call $extend16_s (i32.const 0)) (i32.const 0))
;;    (call $assert_eq_i32 (i32.const 1000) (call $extend16_s (i32.const 0x7fff)) (i32.const 32767))
;;    (call $assert_eq_i32 (i32.const 1000) (call $extend16_s (i32.const 0x8000)) (i32.const -32768))
;;    (call $assert_eq_i32 (i32.const 1000) (call $extend16_s (i32.const 0xffff)) (i32.const -1))
;;    (call $assert_eq_i32 (i32.const 1000) (call $extend16_s (i32.const 0x0123_0000)) (i32.const 0))
;;    (call $assert_eq_i32 (i32.const 1000) (call $extend16_s (i32.const 0xfedc_8000)) (i32.const -0x8000))
;;    (call $assert_eq_i32 (i32.const 1000) (call $extend16_s (i32.const -1)) (i32.const -1))

    (call $assert_eq_i32 (i32.const 2001) (call $eqz (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2002) (call $eqz (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2003) (call $eqz (i32.const 0x80000000)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2004) (call $eqz (i32.const 0x7fffffff)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2005) (call $eqz (i32.const 0xffffffff)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2006) (call $eq (i32.const 0) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2007) (call $eq (i32.const 1) (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2008) (call $eq (i32.const -1) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2009) (call $eq (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2010) (call $eq (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2011) (call $eq (i32.const -1) (i32.const -1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2012) (call $eq (i32.const 1) (i32.const 0)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2013) (call $eq (i32.const 0) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2014) (call $eq (i32.const 0x80000000) (i32.const 0)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2015) (call $eq (i32.const 0) (i32.const 0x80000000)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2016) (call $eq (i32.const 0x80000000) (i32.const -1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2017) (call $eq (i32.const -1) (i32.const 0x80000000)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2018) (call $eq (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2019) (call $eq (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2020) (call $ne (i32.const 0) (i32.const 0)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2021) (call $ne (i32.const 1) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2022) (call $ne (i32.const -1) (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2023) (call $ne (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2024) (call $ne (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2025) (call $ne (i32.const -1) (i32.const -1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2026) (call $ne (i32.const 1) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2027) (call $ne (i32.const 0) (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2028) (call $ne (i32.const 0x80000000) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2029) (call $ne (i32.const 0) (i32.const 0x80000000)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2030) (call $ne (i32.const 0x80000000) (i32.const -1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2031) (call $ne (i32.const -1) (i32.const 0x80000000)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2032) (call $ne (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2033) (call $ne (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 1))

    (call $assert_eq_i32 (i32.const 2100) (call $lt_s (i32.const 0) (i32.const 0)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2100) (call $lt_s (i32.const 1) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2100) (call $lt_s (i32.const -1) (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2100) (call $lt_s (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2100) (call $lt_s (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2100) (call $lt_s (i32.const -1) (i32.const -1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2100) (call $lt_s (i32.const 1) (i32.const 0)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2100) (call $lt_s (i32.const 0) (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2100) (call $lt_s (i32.const 0x80000000) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2100) (call $lt_s (i32.const 0) (i32.const 0x80000000)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2100) (call $lt_s (i32.const 0x80000000) (i32.const -1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2100) (call $lt_s (i32.const -1) (i32.const 0x80000000)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2100) (call $lt_s (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2100) (call $lt_s (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0))

    (call $assert_eq_i32 (i32.const 2200) (call $lt_u (i32.const 0) (i32.const 0)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2200) (call $lt_u (i32.const 1) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2200) (call $lt_u (i32.const -1) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2200) (call $lt_u (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2200) (call $lt_u (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2200) (call $lt_u (i32.const -1) (i32.const -1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2200) (call $lt_u (i32.const 1) (i32.const 0)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2200) (call $lt_u (i32.const 0) (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2200) (call $lt_u (i32.const 0x80000000) (i32.const 0)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2200) (call $lt_u (i32.const 0) (i32.const 0x80000000)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2200) (call $lt_u (i32.const 0x80000000) (i32.const -1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2200) (call $lt_u (i32.const -1) (i32.const 0x80000000)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2200) (call $lt_u (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2200) (call $lt_u (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 1))

    (call $assert_eq_i32 (i32.const 2300) (call $le_s (i32.const 0) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2300) (call $le_s (i32.const 1) (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2300) (call $le_s (i32.const -1) (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2300) (call $le_s (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2300) (call $le_s (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2300) (call $le_s (i32.const -1) (i32.const -1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2300) (call $le_s (i32.const 1) (i32.const 0)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2300) (call $le_s (i32.const 0) (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2300) (call $le_s (i32.const 0x80000000) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2300) (call $le_s (i32.const 0) (i32.const 0x80000000)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2300) (call $le_s (i32.const 0x80000000) (i32.const -1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2300) (call $le_s (i32.const -1) (i32.const 0x80000000)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2300) (call $le_s (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2300) (call $le_s (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0))

    (call $assert_eq_i32 (i32.const 2400) (call $le_u (i32.const 0) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2400) (call $le_u (i32.const 1) (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2400) (call $le_u (i32.const -1) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2400) (call $le_u (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2400) (call $le_u (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2400) (call $le_u (i32.const -1) (i32.const -1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2400) (call $le_u (i32.const 1) (i32.const 0)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2400) (call $le_u (i32.const 0) (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2400) (call $le_u (i32.const 0x80000000) (i32.const 0)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2400) (call $le_u (i32.const 0) (i32.const 0x80000000)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2400) (call $le_u (i32.const 0x80000000) (i32.const -1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2400) (call $le_u (i32.const -1) (i32.const 0x80000000)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2400) (call $le_u (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2400) (call $le_u (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 1))

    (call $assert_eq_i32 (i32.const 2500) (call $gt_s (i32.const 0) (i32.const 0)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2500) (call $gt_s (i32.const 1) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2500) (call $gt_s (i32.const -1) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2500) (call $gt_s (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2500) (call $gt_s (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2500) (call $gt_s (i32.const -1) (i32.const -1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2500) (call $gt_s (i32.const 1) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2500) (call $gt_s (i32.const 0) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2500) (call $gt_s (i32.const 0x80000000) (i32.const 0)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2500) (call $gt_s (i32.const 0) (i32.const 0x80000000)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2500) (call $gt_s (i32.const 0x80000000) (i32.const -1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2500) (call $gt_s (i32.const -1) (i32.const 0x80000000)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2500) (call $gt_s (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2500) (call $gt_s (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 1))

    (call $assert_eq_i32 (i32.const 2600) (call $gt_u (i32.const 0) (i32.const 0)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2600) (call $gt_u (i32.const 1) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2600) (call $gt_u (i32.const -1) (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2600) (call $gt_u (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2600) (call $gt_u (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2600) (call $gt_u (i32.const -1) (i32.const -1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2600) (call $gt_u (i32.const 1) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2600) (call $gt_u (i32.const 0) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2600) (call $gt_u (i32.const 0x80000000) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2600) (call $gt_u (i32.const 0) (i32.const 0x80000000)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2600) (call $gt_u (i32.const 0x80000000) (i32.const -1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2600) (call $gt_u (i32.const -1) (i32.const 0x80000000)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2600) (call $gt_u (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2600) (call $gt_u (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0))

    (call $assert_eq_i32 (i32.const 2700) (call $ge_s (i32.const 0) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2700) (call $ge_s (i32.const 1) (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2700) (call $ge_s (i32.const -1) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2700) (call $ge_s (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2700) (call $ge_s (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2700) (call $ge_s (i32.const -1) (i32.const -1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2700) (call $ge_s (i32.const 1) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2700) (call $ge_s (i32.const 0) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2700) (call $ge_s (i32.const 0x80000000) (i32.const 0)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2700) (call $ge_s (i32.const 0) (i32.const 0x80000000)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2700) (call $ge_s (i32.const 0x80000000) (i32.const -1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2700) (call $ge_s (i32.const -1) (i32.const 0x80000000)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2700) (call $ge_s (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2700) (call $ge_s (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 1))

    (call $assert_eq_i32 (i32.const 2800) (call $ge_u (i32.const 0) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2800) (call $ge_u (i32.const 1) (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2800) (call $ge_u (i32.const -1) (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2800) (call $ge_u (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2800) (call $ge_u (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2800) (call $ge_u (i32.const -1) (i32.const -1)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2800) (call $ge_u (i32.const 1) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2800) (call $ge_u (i32.const 0) (i32.const 1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2800) (call $ge_u (i32.const 0x80000000) (i32.const 0)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2800) (call $ge_u (i32.const 0) (i32.const 0x80000000)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2800) (call $ge_u (i32.const 0x80000000) (i32.const -1)) (i32.const 0))
    (call $assert_eq_i32 (i32.const 2800) (call $ge_u (i32.const -1) (i32.const 0x80000000)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2800) (call $ge_u (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 1))
    (call $assert_eq_i32 (i32.const 2800) (call $ge_u (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0))
    (call $wasi$print_i32_ln  (i32.const 666))
)
))
